FROM golang:1.17-alpine AS builder
WORKDIR /build
ADD . ./
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn \
CGO_ENABLED=0
RUN go mod download
RUN go build -o main .
FROM alpine:latest
WORKDIR /build/
COPY ./conf /build/conf/
COPY --from=builder /build/main .
EXPOSE 8080
ENTRYPOINT ["./main"]